﻿@model Viettel.VOFFICE.Web.Models.TreeviewModel
<script src="@Url.Content("~/Scripts/jstree/jquery.jstree.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function() {
        buildPopupTree();
        $("#controllerTree").bind("reselect.jstree", function () {
            $("#controllerTree").jstree("select_node", "#admin");
        });
    });
    function buildPopupTree() {
        $('#controllerPopupTree').jstree({
            json_data: {
                "ajax": {
                    "url": "/manageactionname/build_controller_tree/?nocache=" + (new Date()).toJSON(),
                    "type": "POST",
                    "dataType": "json",
                    "contentType": "application/json charset=utf-8"
                }
            },
            plugins: ["themes", "json_data", "ui"]
        });
        $('#controllerPopupTree').bind("loaded.jstree", function (event, data) {
            $('#controllerPopupTree').jstree("open_all");
        });
        $("#controllerPopupTree").bind("reselect.jstree", function () {
            $("#controllerPopupTree").jstree('select_node', 'ul > li:first');
        });
    };
</script>
<div id="controllerPopupTree">
</div>